<?php
//后台登陆控制
include_once('admin_global.php');
$db->Get_user_shell_check($uid, $shell);   //检测用户是否登录
$db->Get_user_type_check($uid, $shell);    //检测用户权限
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>添加管理员</title>
    <link rel="stylesheet" href="css/right.css" type="text/css" />
    <script src="js/jquery.js" type="text/javascript"></script>
</head>
<script>
    window.onload=function(){
        var myform=document.getElementById('form1');
        var reg=new RegExp("/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/");
        myform.onsubmit=function(){
            if(myform.userName.value==""){
                alert('请输入用户名！');
                myform.userName.focus();
                return false;
            }
            if(myform.userPassword.value==""){
                alert('请输入密码！');
                myform.userPassword.focus();
                return false;
            }
            if(myform.ReuserPassword.value!=myform.userPassword.value){
                alert('两次输入的密码不一致！');
                myform.ReuserPassword.focus();
                return false;
            }
            var email=myform.userEmail.value;
            if(email!=""){
                var re=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
                if(re.test(email)!=true){
                    alert("电子邮件格式不符合要求！");
                    myform.userEmail.focus();
                    return false;
                }
            }
        }
    }
</script>
<body>
<div id="right_main">
    <div class="right_content">
        <div class="right_top_menu">
            <h3>
                您当前的位置：后台 > 管理设置 > 添加管理员
            </h3>
        </div>
        <div class="right_center_content">
            <form id="form1" method="post" action="addAdmin_check.php">
                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top" >
                            <div class="txl_search"></div>
                            <table cellpadding="0" cellspacing="0" border="0" width="100%"  class="sy_table">
                                <tr>
                                    <th colspan="2" >添加管理员</th>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">管理员名称：</td>
                                    <td width="65%"><input type="text" name="userName"   class="int_text" value="" size="40" /> </td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">管理员密码：</td>
                                    <td width="65%"><input type="password" name="userPassword"  id="userPassword" class="int_text" value="" size="40" /></td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">重复密码：</td>
                                    <td width="65%"><input type="password" name="ReuserPassword"  class="int_text" value="" size="40" /></td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">管理员邮箱：</td>
                                    <td width="65%"><input type="text" name="userEmail"  class="int_text" value="" size="40" /></td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">管理员类型：</td>
                                    <td width="65%">
                                        <select name="userType">
                                            <option  selected value="超级管理员">超级管理员</option>
                                            <option  value="普通管理员">普通管理员</option>
                                        </select>
                                        &nbsp;&nbsp;* 超级管理员拥有后台管理的全部权限，普通管理员只有部分权限！</td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">性别：</td>
                                    <td width="65%">
                                        <select name="userSex">
                                            <option  selected value="男">男</option>
                                            <option  value="女">女</option>
                                            <option value="保密">保密</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">是否可用：</td>
                                    <td width="65%"><input type="checkbox" name="userEnabled"  checked="checked" class="int_text"  size="40" /></td>
                                </tr>
                                <tr>
                                    <td width="35%" align="right">备注：</td>
                                    <td width="65%"><input type="text" name="userRemark"  class="int_text" value="" size="40" /></td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="center" height='30'>
                                        <input type="submit" class="btn_ipt01" name="addAdmin" value=" 添加管理员 "/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
</html>
